home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1994 October / 1994-10b.d64 / units converter (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  1KB  |  36 lines

  1. 10 printchr$(147):rem clear screen
  2. 20 poke53280,6:rem border to match screen
  3. 30 poke646,1:rem print everything white
  4. 40 x=16:dimc(x),e$(x),m$(x)
  5. 50 forn=1tox:readc(n),e$(n),m$(n):next
  6. 60 print"(1) in to km    (17) km to in
  7. 70 [153]"(2) in to m     (18) m to in
  8. 80 print"(3) in to cm    (19) cm to in
  9. 90 [153]"(4) in to mm    (20) mm to in
  10. 100 print"(5) ft to km    (21) km to ft
  11. 110 [153]"(6) ft to m     (22) m to ft
  12. 120 print"(7) ft to cm    (23) cm to ft
  13. 130 [153]"(8) ft to mm    (24) mm to ft
  14. 140 print"(9) yd to km    (25) km to yd
  15. 150 [153]"(10) yd to m    (26) m to yd
  16. 160 print"(11) yd to cm   (27) cm to yd
  17. 170 [153]"(12) yd to mm   (28) mm to yd
  18. 180 print"(13) mi to km   (29) km to mi
  19. 190 [153]"(14) mi to m    (30) m to mi
  20. 200 print"(15) mi to cm   (31) cm to mi
  21. 210 [153]"(16) mi to mm   (32) mm to mi
  22. 220 input"which number";n
  23. 230 ifn<1thenprint"[145][145][145]":goto220
  24. 240 ifn>32thenprint"[145][145][145]":goto220
  25. 250 ifn>16then290
  26. 260 print"how many "e$(n);
  27. 270 inputq:a=q*c(n)
  28. 280 print:printq;e$(n)" ="a;m$(n):end
  29. 290 print"how many "m$(n-x);
  30. 300 inputq:a=q*1/c(n-x)
  31. 310 print:printq;m$(n-x)" ="a;e$(n-x):end
  32. 320 data.0000254,in,km,.0254,in,m,2.54,in,cm,25.4,in,mm
  33. 330 data.0003048,ft,km,.3048,ft,m,30.48,ft,cm,304.8,ft,mm
  34. 340 data.0009144,yd,km,.9144,yd,m,91.44,yd,cm,914.4,yd,mm
  35. 350 data1.609344,mi,km,1609.344,mi,m,160934.4,mi,cm,1609344,mi,mm
  36.